<script setup lang="ts">
type ErrorType = {
 error: {
  url?: string
  statusCode?: number
  statusMessage?: string
  message?: string
  data?: any
 }
}
const props = defineProps<ErrorType>()
const handleError = () => clearError({ redirect: '/' })
</script>

<template>
  <div class="w-[100vw] h-[100vh] flex justify-center items-center">
    <n-result
        :status="error.statusCode + ''"
        :title=" error.statusMessage || '系统异常'"
        :description="error.message  ||  '系统异常，请联系管理员'"
    >
        <template #footer>
            <n-button @click="handleError">返回首页</n-button>
        </template>
    </n-result>
  </div>
</template>